package org.dwpd.utils;

import org.dwpd.domain.user.UserDTO;

/**
 * Package:org.dwpd.utils
 *
 * @ClassName:UserHolder
 * @Create:2024/8/16 13:30
 **/
// TODO 用户线程池
public class UserHolder {
    private static final ThreadLocal<UserDTO> tl = new ThreadLocal<>();

    public static void saveUser(UserDTO userDTO){
        tl.set(userDTO);
    }

    public static UserDTO getUser(){
        return tl.get();
    }

    public static final void remove(){
        tl.remove();
    }

}
